1. Field of the Invention
The present invention relates to a wireless communications protocol. More specifically, the present invention discloses a method for determining acceptable sequence number ranges in a transmission time interval.
2. Description of the Prior Art
The surge in public demand for wireless communication devices has placed pressure upon industry to develop increasingly sophisticated communications standards. The 3rd Generation Partnership Project (3GPP(trademark)) is an example of such a new communications protocol. Such standards utilize a three-layer approach to communications. Please refer to FIG. 1. FIG. 1 is a block diagram of the three layers in a communications protocol. In a typical wireless environment, a first station 10 is in wireless communications with one or more second stations 20. An application 13 on the first station 10 composes a message 11 and has it delivered to the second station 20 by handing the message 11 to a layer 3 interface 12. The layer 3 interface 12 may also generate some layer 3 signaling messages 12a for the purpose of controlling layer 3 operations. An example of such a layer 3 signaling message is a request for ciphering key changes, which are generated by the layer 3 interfaces 12 and 22 of both the first and the second stations, respectively. The layer 3 interface 12 delivers either the message 11 or the layer 3 signaling message 12a to a layer 2 interface 16 in the form of layer 2 service data units (SDUs) 14. The layer 2 SDUs 14 may be of any length. The layer 2 interface 16 composes the SDUs 14 into one or more layer 2 protocol data units (PDUs) 18. Each layer 2 PDU 18 is of a fixed length, and is delivered to a layer 1 interface 19. The layer 1 interface 19 is the physical layer, transmitting data to the second station 20. The transmitted data is received by the layer 1 interface 29 of the second station 20 and reconstructed into one or more PDUs 28, which are passed up to the layer 2 interface 26. The layer 2 interface 26 receives the PDUs 28 and builds up one or more layer 2 SDUs 24. The layer 2 SDUs 24 are passed up to the layer 3 interface 22. The layer 3 interface 22, in turn, converts the layer 2 SDUs 24 back into either a message 21, which should be identical to the original message 11 that was generated by the application 13 on the first station 10, or a layer 3 signaling message 22a, which should be identical to the original signaling message 12a generated by the layer 3 interface 12 and which is then processed by the layer 3 interface 22. The received message 21 is passed to an application 23 on the second station 20.
Of particular interest is the layer 2 interface, which acts as a buffer between the relatively high-end data transmission and reception requests of the layer 3 interfaces 12 and 22, and the low-level requirements of the physical transmission and reception process at the layer 1 interfaces 19 and 29. Please refer to FIG. 2. FIG. 2 is a simplified diagram of a transmission/reception process from a layer 2 perspective. The layer 2 interface 32 of a first station 30 receives a string of SDUs 34 from the layer 3 interface 33. The layer 2 SDUs 34 are sequentially ordered from 1 to 5, and are of an unequal length. The layer 2 interface 32 converts the string of SDUs 34 into a string of layer 2 PDUs 36. The layer 2 PDUs 36 are sequentially ordered from 1 to 4, and are usually all of an equal length. The string of layer 2 PDUs 36 is then sent off to the layer 1 interface 31 for transmission. A reverse process occurs at the second station 40, with the second station 40 layer 2 interface 42 converting a received string of layer 2 PDUs 46 into a received string of layer 2 SDUs 44, which are then passed up to a layer 3 interface 43. There are two delivery modes: in-sequence delivery and out-of-sequence delivery. If the established connection between the first station 30 and the second station 40 is configured to be in the in-sequence delivery mode, the multi-layered protocol insists that the layer 2 interface 42 present the SDUs 44 to the layer 3 interface 43 in order. That is, the layer 2 interface 42 must present the layer 2 SDUs 44 to the layer 3 interface 43 in the sequential order of the SDUs 44, beginning with SDU 1 and ending with SDU 5. The ordering of the SDUs 44 may not be scrambled, nor may a subsequent SDU 44 be delivered to the layer 3 interface 43 until all of the prior SDUs 44 have been delivered. However, if the established connection is configured to be in the out-of-sequence delivery mode, the layer 2 interface 42 can present the layer 2 SDUs 44 to the layer 3 interface 43 out of sequential order.
In line transmissions, such requirements are relatively easy to fulfill. In the noisy environment of wireless transmissions, however, the second station 40 often misses data. Additionally, under some transmission modes, the layer 2 interface 32 of the first station 30 may actually discard some of the layer 2 SDUs 34 or layer 2 PDUs 36 after a predetermined amount of time if the layer 2 SDUs 34 or PDUs 36 have not been transmitted. Some layer 2 PDUs in the received string of layer 2 PDUs 46 will therefore be missing, either due to deliberate discarding from the transmitting side, or from improper reception on the receiver side. Ensuring that the layer 3 SDUs 44 are presented in order, when the system is in the in-sequence delivery mode, can thus pose a significant challenge. Even in the out-of sequence delivery mode, a layer 2 SDU 44 cannot be presented until all of its composing layer 2 PDUs 46 have been correctly received. The format of the layer 2 PDUs 36, 46 is thus carefully considered to help overcome these obstacles.
Generally speaking, there are two broad modes for transmitting and receiving data: acknowledged mode, and unacknowledged mode. For acknowledged mode data, the second station 40 sends a special acknowledging signal to the first station 30 to indicate successfully received layer 2 PDUs 46. No such signaling is performed for unacknowledged mode data. For purposes of the present discussion, only the unacknowledged mode of data transmission and reception is considered. Please refer to FIG. 3 in conjunction with FIG. 2. FIG. 3 is a block diagram of an unacknowledged mode data (UMD) PDU 50, as defined by the 3GPP(trademark) TS 25.322 specification. The UMD PDU 50 is used to transmit unacknowledged mode SDU data from the layer 3 interface 33 of the first station 30, which is then received and reassembled by the second station 40 and presented to the layer 3 interface 43 as the layer 2 SDUs 44. That is, layer 2 UMD PDUs 36, 46 are used to carry the layer 2 SDUs 34, 44 that originate from the layer 3 interfaces 33, 43. The UMD PDU 50 is divided into several fields, as defined by the layer 2 protocol. The first field 51 is a sequence number (SN) field, and is seven bits long. Successive UMD PDUs have successively higher sequence numbers, and in this way a receiver can properly reassembled UMD PDUs 46 to form the SDUs 44. That is, if a UMD PDU 36 is transmitted with a sequence number value equal to 19, the next UMD PDU 36 would be transmitted with a sequence number value equal to 20, and so forth. The next field, 52a, is an extension bit, and when set indicates the presence of a following length indicator (LI). An LI may be either 7 bits long or 15 bits long, and is used to indicate the ending position of an SDU within the UMD PDU 50. If a single SDU completely fills the data region 58 of the UMD PDU 50, then the extension bit 52a would be zero, thereby indicating that no LI is present. In the example UMD PDU 50, however, there are at least two SDUs ending in the PDU 50: SDU_157a, and SDU_257b. There must, therefore, be two LIs to indicate the respective ends of the SDU_157a and the SDU_257b. A UMD PDU following the UMD PDU 50 would hold the LI for SDU_357c. The first LI, LI1, is in field 56a following the extension bit field 52a, and marks the end of the SDU_157a. LI1 56a has an extension bit 52b that is set, indicating the presence of another LI, LI2 in field 56b. LI2 56b indicates the ending position of the SDU_257b, and has an extension bit 52c that is cleared, signifying that there are no more LIs, and that the data region 58 is thus beginning. The data region is used to carry the SDUs 57a, 57b, 57c. 
Please refer to FIG. 4 in conjunction with FIG. 5. FIG. 4 is a more detailed block diagram of a prior art layer 2 interface 60. FIG. 5 is a timing diagram of transmission time intervals (TTIs) 72. The layer 2 interface 60 comprises a radio link control (RLC) layer 62 on top of, and in communications with, a medium access control (MAC) layer 64. The MAC layer 64 acts as an interface between the RLC layer 62 and the layer 1 interface 61. The MAC layer 64 divides the transmission of PDUs 63, which the MAC layer 64 receives from the RLC layer 62, into a series of transmission time intervals (TTIs) 72. Each TTI 72 has an interval length that is identical to the other TTIs 72, such as a 20 milliseconds (ms) interval. Within the time span of each TTI 72, the MAC layer 64 sends off a set of transport blocks 74 to the layer 1 interface 61 to be transmitted. The set of transport blocks 74 comprises a predetermined number of transport blocks 74a. Each of the transport blocks 74a comprises one RLC PDU 75 and may optionally carry a MAC header 76. All of the RLC PDUs 75 and, thus, the transport blocks 74a within each TTI 72 are of the same length. The number of RLC PDUs 75 (or transport blocks 74a) within each transport block set 74 between TTIs 72 may change. For example, in FIG. 5 the first TTI 72 transmits six PDUs 75, and the subsequent TTI 72 transmits three PDUs 75. The actual data length of the PDUs 75 may also vary from TTI 72 to TTI 72, but is always the same within each TTI 72. Consequently, prior to transmission for each TTI 72, the MAC layer 64 informs the RLC layer 62 of the number of PDUs 75 required for the TTI 72, and the size for the PDUs 75 within the TTI 72. The RLC layer 62 composes SDUs 65a, held in a buffer 65, into appropriately sized PDUs, and delivers the required number of PDUs 63 to the MAC layer 64. As noted, the MAC layer may optionally add a MAC header 76 to each RLC PDU 75 to generate the transport blocks 74a for the transport block set 74, and then the transport block set 74 of PDUs 74 is sent off to the layer 1 interface 61 for transmission.
For purposes of security, PDUs 63, 75 are encrypted before being delivered to the layer 1 interface 61. The encryption is usually performed in either the MAC layer 64 or the RLC layer 62. For purposes of the present discussion, it will be assumed that encryption of the PDUs 63, 75 occurs in the RLC layer 62. Prior to delivering PDUs 63 to the MAC layer 64, an encryption engine 66 encrypts all but the first octet of data within each PDU 63, 75, and delivers encrypted PDUs 63 to the MAC layer 64. As the first octet of each PDU 63, 75 is not encrypted, the sequence number 51 (from FIG. 3) is transmitted in an unencrypted state. The reason for this is that the encryption engine 66 uses the sequence number 51 of each PDU 63, 75 to generate the encrypted PDUs 63, 75. Consequently, on the receiver side, the sequence number 51 must be made available to perform the decryption of the PDUs 75. The sequence number 51 of each PDU is used to form a count-c value 66c. The count-c value 66c is a 32-bit number that comprises a hyper-frame number (HFN) 66h as the most significant 25 bits, and the sequence number 51 of the PDU 63, 75 to be encrypted as the least significant 7 bits 66s. The HFN 66h is initially zero, but is incremented upon detection of rollover in the PDU 63, 75 sequence numbers 51. For example, if the HFN 66h has a value of zero, and a PDU 63, 75 has a sequence number value 51 of 127, count-c 66c would have a value of 127 that is used to encrypt the PDU 63, 75. A subsequent PDU 63, 75 would have a sequence number value 51 of zero, due to rollover, and the encryption engine 66 would thus increment the HFN value 66h to one. Count-c, used to encrypt this subsequent PDU 63, 75, would thus be 128. The sequence number values 66s are transmitted with the respective PDUs 75, as they are unencrypted. The HFN value 66h, however, is not transmitted, and thus must remain synchronized on both the reception and transmission sides for the PDUs 75 to be properly decrypted.
Please refer to FIG. 6 in conjunction with FIG. 4. FIG. 6 is a diagram of transmission and reception of PDUs 82 and 92. PDUs 82, each with an indicated sequence number (SN) value, are transmitted from a transmission side 80. The PDUs 82 are then received on a receiver side 90 and assembled into PDUs 92, each with an indicated sequence number (SN). The transmission side 80 sends a first block of PDUs 82 with sequence numbers incrementing from 110 to 112. The transmission side then discards PDUs 82 with sequence numbers ranging from 113 to 125, indicated by the Xs 83, and continues transmitting with sequence number values from 126 to 1. Rollover of the 7-bit sequence numbers occurs after a value of 127. Again, PDUs 82 are discarded that have sequence number values from 2 to 19, indicated by Xs 84, and then transmission continues with PDUs 82 having sequence number values incrementing from 20 to 23. More PDUs 82 are discarded, indicated by Xs 85, and transmission resumes with PDUs 82 having sequence number values beginning at 30. Discarding of the PDUs 83, 84 and 85 may occur at the transmission side 80 due to time-out errors, or for other reasons. The receiving side 90, however, is not directly informed of these PDU discards 83, 84 and 85, and infers them from the non-sequentiality of the sequence numbers in the received PDUs 92. For example, between received PDUs 93a and 93b, the receiving side 90 infers that the PDUs 83 have been discarded, and must react accordingly to properly reassemble the PDUs 92 into correct SDUs. At received PDU 96b, rollover occurs in the sequence numbers, and so the receiving side 90 increments its HFN 66h accordingly. Received PDU 96b thus uses a different HFN 66h for decryption than received PDU 96a. This is proper, as it tracks the HFNs 66h of the corresponding transmitted PDUs 86a and 86b. As noted previously, the synchronization of the HFN number 66h on the transmission side 80 with the reception side 90 is of critical importance for the proper decryption of the received PDUs 92.
Unfortunately, the transmission process is not error-free. PDUs 82 can get lost or corrupted. For example, on the reception side 90, a PDU 97 is received with an erroneous sequence number value of 100, instead of the correct sequence number value of 23 for the correspondingly transmitted PDU 87. A layer 1 circular redundancy check (CRC) should generally detect errors in the received PDUs 92 and discard any found to be corrupted. However, it is possible for some corrupted PDUs 92 to avoid detection, and, for the present example, we may imagine that the corrupted PDU 97 has been damaged in such a way as to result in the incorrect sequence number value of 100. On the reception side 90, we may imagine that the encryption engine 66 uses an HFN value of one to decrypt the PDU 98a. This is the same HFN value 66h that was used on the transmission side 80 to encrypt the PDU 88a, and so the received PDU 98a is properly decrypted. The corrupted PDU 97 will not be properly decrypted, however, as its sequence number value of 100 does not correspond to the sequence number value of 23 that was used to encrypt the transmitted PDU 87. The RLC layer 62 on the reception side will also assume that PDUs 82 with sequence number values ranging from 23 to 99 were discarded by the transmission side 80. This is incorrect. Worse still, though, is that upon reception of the PDU 98b, the encryption engine 66 on the reception side 90 will incorrectly assume that PDUs 82 on the transmission side 80 with sequence number values ranging from 101 to 127 and zero to 29 were discarded prior to transmission, or were lost in transmission. The encryption engine 66 on the reception side 90 will thus assume that rollover of the sequence numbers has occurred and increment its HFN value 66h accordingly. The reception-side 90 HFN value 66h will thus go from a value of one to a value of two. When the reception side 90 attempts to decrypt the received PDU 98b, an HFN 66h value of two will be used, which is out of synch with the HFN value 66h of one used on the transmission side 80. The PDU 98b will thus be improperly decrypted, resulting in a meaningless PDU 92. Additionally, as the HFN values 66h on the transmission side 80 and reception side 90 are no longer synchronized, all subsequent received PDUs 92 will also be improperly decrypted. The communications channel between the reception side 90 and transmission side 80 is effectively destroyed.
It is therefore a primary objective of this invention to provide a method for determining acceptable ranges of received sequence numbers in a wireless communications protocol.
Briefly summarized, the preferred embodiment of the present invention discloses a method for determining acceptable ranges of received sequence numbers in a wireless communications protocol. The wireless communications protocol utilizes protocol data units (PDUs) for transmitting and receiving service data units (SDUs). Each PDU has a sequence number of n bits for indicating a relative sequential ordering of the PDU in a transmitted or received stream of PDUs. A transmission time interval (TTI) is also used in which a predetermined number of PDUs are transmitted or received. PDUs are received within a TTI. A starting sequence number and an ending sequence number for received PDUs within the TTI are found. Any received PDU within the TTI that has a sequence number that is sequentially before the starting sequence number or that is sequentially after the ending sequence number is discarded.
It is an advantage of the present invention that by discarding PDUs in the TTI that have sequence number values that are not within the range of the starting and ending sequence numbers, loss of synchronization in the hyper-frame numbers between transmitting and receiving stations is avoided. Additionally, the discarding of such PDUs helps to prevent the passing up to higher layers of corrupted data.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment, which is illustrated in the various figures and drawings.